home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / AmiTCPsdk_40.lha / AmiTCP-4.0 / netinclude / net / if_arp.h next >
C/C++ Source or Header  |  1994-10-05  |  4KB  |  111 lines

  1. #ifndef NET_IF_ARP_H
  2. #define NET_IF_ARP_H \
  3.        "$Id: if_arp.h,v 4.1 1994/10/05 23:16:26 ppessi Exp $"
  4. /*
  5.  *      Interface to the Address Resolution Protocol
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. /*
  13.  * Address Resolution Protocol.
  14.  *
  15.  * See RFC 826 for protocol description.  ARP packets are variable
  16.  * in size; the arphdr structure defines the fixed-length portion.
  17.  * Protocol type values are the same as those for 10 Mb/s Ethernet.
  18.  * It is followed by the variable-sized fields ar_sha, arp_spa,
  19.  * arp_tha and arp_tpa in that order, according to the lengths
  20.  * specified.  Field names used correspond to RFC 826.
  21.  */
  22. struct    arphdr {
  23.     u_short    ar_hrd;        /* format of hardware address */
  24. #define ARPHRD_ETHER     1    /* ethernet hardware address */
  25. #define ARPHRD_ARCNET     7    /* ARCNET hardware address */
  26.     u_short    ar_pro;        /* format of protocol address */
  27.     u_char    ar_hln;        /* length of hardware address */
  28.     u_char    ar_pln;        /* length of protocol address */
  29.     u_short    ar_op;        /* one of: */
  30. #define    ARPOP_REQUEST    1    /* request to resolve address */
  31. #define    ARPOP_REPLY    2    /* response to previous request */
  32. /*
  33.  * The remaining fields are variable in size,
  34.  * according to the sizes above.
  35.  */
  36. /*    u_char    ar_sha[];    \* sender hardware address */
  37. /*    u_char    ar_spa[];    \* sender protocol address */
  38. /*    u_char    ar_tha[];    \* target hardware address */
  39. /*    u_char    ar_tpa[];    \* target protocol address */
  40. };
  41.  
  42. #define MAXADDRARP  16          /* Maximum number of octets in hw address */
  43.  
  44. /*
  45.  * ARP ioctl request. 
  46.  */
  47. struct arpreq {
  48.     struct    sockaddr arp_pa;        /* protocol address */
  49.     struct    {                        /* hardware address */
  50.       u_char sa_len;
  51.       u_char sa_family;        
  52.       char     sa_data[MAXADDRARP];        
  53.     }  arp_ha;        
  54.     int    arp_flags;            /* flags */
  55. };
  56.  
  57. /*  arp_flags and at_flags field values */
  58. #define    ATF_INUSE    0x01    /* entry in use */
  59. #define ATF_COM        0x02    /* completed entry (enaddr valid) */
  60. #define    ATF_PERM    0x04    /* permanent entry */
  61. #define    ATF_PUBL    0x08    /* publish entry (respond for other host) */
  62. #define    ATF_USETRAILERS    0x10    /* has requested trailers */
  63.  
  64. /* 
  65.  * An AmiTCP/IP specific ARP table ioctl request
  66.  */
  67. struct arptabreq {
  68.     struct arpreq  atr_arpreq; /* We want to identify the interface */
  69.     long           atr_size;          /* # of elements in art_table */
  70.     long           atr_inuse;               /* # of elements in use */
  71.     struct arpreq *atr_table;
  72. };
  73.  
  74. /*
  75.  * Copyright (c) 1986 Regents of the University of California.
  76.  * All rights reserved.
  77.  *
  78.  * Redistribution and use in source and binary forms, with or without
  79.  * modification, are permitted provided that the following conditions
  80.  * are met:
  81.  * 1. Redistributions of source code must retain the above copyright
  82.  *    notice, this list of conditions and the following disclaimer.
  83.  * 2. Redistributions in binary form must reproduce the above copyright
  84.  *    notice, this list of conditions and the following disclaimer in the
  85.  *    documentation and/or other materials provided with the distribution.
  86.  * 3. All advertising materials mentioning features or use of this software
  87.  *    must display the following acknowledgement:
  88.  *    This product includes software developed by the University of
  89.  *    California, Berkeley and its contributors.
  90.  * 4. Neither the name of the University nor the names of its contributors
  91.  *    may be used to endorse or promote products derived from this software
  92.  *    without specific prior written permission.
  93.  *
  94.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  95.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  96.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  97.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  98.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  99.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  100.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  101.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  102.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  103.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  104.  * SUCH DAMAGE.
  105.  *
  106.  *    @(#)if_arp.h    7.4 (Berkeley) 6/28/90
  107.  */
  108. #endif /* NET_IF_ARP_H */
  109.  
  110.  
  111.